import type { RouteRecordRaw } from 'vue-router';

export const Routes: Array<RouteRecordRaw> = [
    // 首页
    {
      path:'/',
      name:"index",
      redirect:'/index/recommend',
    },
    // 404
    {
        path: '/404',
        name: '404',
        component: () => import('@/views/error/404.vue'),
        meta: {
            isHidden:true
        }
    },
    // 资源
    {
        path:'/index',
        name:'Index',
        redirect:'/index/recommend',
        component:() => import('@/views/index/index.vue'),
        children:[
            { // 推荐
                path:'recommend',
                name:'Recommend',
                component:() => import('@/views/index/Recommend/index.vue'),
                meta:{
                    title:'推荐'
                }
            },
            { // 作品
                path:'original',
                name:'Original',
                component:() => import('@/views/index/Original/index.vue'),
                meta:{
                    title:'作品'
                }
            },
            { // 教程
                path:'course',
                name:'Course',
                component:() => import('@/views/index/Course/index.vue'),
                meta:{
                    title:'教程'
                }
            },
            { // 专题
                path:'specialTopic',
                name:'SpecialTopic',
                component:() => import('@/views/index/SpecialTopic/index.vue'),
                meta:{
                    title:'专题'
                }
            },
            { // 动态
                path:'information',
                name:'Information',
                component:() => import('../views/index/Information/index.vue'),
                meta:{
                    title:'动态'
                }
            },
            { // 关注
                path:'attention',
                name:'Attention',
                component:() => import('@/views/index/Attention/index.vue'),
                meta:{
                    title:'关注'
                }
            },
            { // 兴趣
                path:'interest/:name',
                name:'Interest',
                component:() => import('@/views/index/Interest/index.vue'),

            }
        ]
    },
    // 课程
    {
        path:'/discovery',
        name:'Discovery',
        component:() => import('@/views/discovery/index.vue'),
        redirect:'/discovery/vip_zone',
        children:[
            {
                path:'vip_zone',
                name:'VipZone',
                component:() => import('@/views/discovery/VipZone/index.vue'),
                meta:{
                    title:'会员专区'
                }
            },
            {
                path:'video_courses',
                name:'VideoCourses',
                component:() => import('@/views/discovery/VideoCourses/index.vue'),
                meta:{
                    title:'视频课'
                }
            },
            {
                path:'live_courses',
                name:'LiveCourses',
                component:() => import('@/views/discovery/LiveCourses/index.vue'),
                meta:{
                    title:'直播课'
                }
            },
            {
                path:'major_courses',
                name:'MajorCourses',
                component:() => import('@/views/discovery/MajorCourses/index.vue'),
                meta:{
                    title:'线下课'
                }
            },
            {
                path:'zone_list',
                name:'ZoneList',
                component:() => import('@/views/discovery/ZoneList/index.vue'),
                meta:{
                    title:'主题'
                }
            }
        ]
    },
    // 练习室
    {
        path:'/training',
        name:'Training',
        component:() => import('@/views/training/index.vue')
    },
    // 交流
    {
        path:'/communication',
        name:'Communication',
        component:() => import('@/views/communication/index.vue'),
        redirect:'/communication/systemNote',
        children:[
            {
                path:'systemNote',
                name:'SystemNote',
                component:() => import('@/views/communication/SystemNote/index.vue'),
                meta:{
                    title:'系统通知'
                }
            },
            {
                path:'interactNote',
                name:'InteractNote',
                component:() => import('@/views/communication/InteractNote/index.vue'),
                meta:{
                    title:'互动通知'
                }
            },
            {
                path:'orderNote',
                name:'OrderNote',
                component:() => import('@/views/communication/OrderNote/index.vue'),
                meta:{
                    title:'订单通知'
                }
            }
        ]
    },
    // 我的
    {
        path:'/center',
        name:'Center',
        component:() => import('@/views/center/index.vue'),
        redirect:'/center/dynamics',
        children:[
            {
                path: 'dynamics',
                name: 'Dynamics',
                component:() => import('@/views/center/Dynamics/index.vue'),
                meta: {
                    title: '资源动态'
                }
            },
            {
                path: 'vip',
                name: 'Vip',
                component:() => import('@/views/center/Vip/index.vue'),
                meta: {
                    title: '我的会员'
                }
            },
            {
                path: 'profile',
                name: 'Profile',
                component:() => import('@/views/center/Profile/index.vue'),
                meta: {
                    title: '我的资料'
                }
            },
        ]
    },
    /* 匹配任意的路由 必须最后注册 */
    {
        path: '/:pathMatch(.*)',
        name: 'Any',
        redirect: '/404',
    }
]
